<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div>
        <h1>The Ajax 03 Page</h1>
        <button onclick="doAjaxGet()">DO Ajax Get</button>
        <button onclick="doAjaxPost()">DO Ajax Post</button>
        <button onclick="doAjaxDelete()">DO Ajax Delete</button>
        <button onclick="doAjaxPut()">DO Ajax Put</button>
    </div>
    <div id="result">

    </div>
    <script src="/js/ajax.js"></script>
        <script>
            function doAjaxPost(){
                const url="/doAjaxPost";
                const params="id=102&city=shenzhen";
                ajaxPost(url,params,function(result){
                    alert(result);
                })
            }
            function doAjaxGet(){
                const url="/doAjaxGet";
                const params="";
                ajaxGet(url,params,function (result){
                    document.getElementById("result").innerHTML=
                        result;
                })
            }
        </script>
</body>
</html>